package com.ksm.client.document.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.ResizeComposite;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.ksm.client.document.presenter.DocumentContainerPresenter.IDocumentContainerView;
import com.ksm.client.document.presenter.DocumentFormPresenter.IDocumentFormView;
import com.ksm.client.document.presenter.DocumentGridPresenter.IDocumentGridView;
import com.ksm.client.document.presenter.DocumentJustificatifPresenter.IDocumentJustificatifView;
import com.ksm.client.document.presenter.DocumentPreviewPresenter.IDocumentPreviewView;
import com.ksm.client.document.presenter.DocumentSearchPresenter.IDocumentSearchView;
import com.sencha.gxt.core.client.resources.ThemeStyles;
import com.sencha.gxt.core.client.resources.ThemeStyles.Styles;
import com.sencha.gxt.widget.core.client.Component;

public class DocumentContainerView extends ResizeComposite implements IDocumentContainerView, IsWidget {

	@UiField(provided = true)
	Styles themeStyles = ThemeStyles.getStyle();

	@Inject
	private IDocumentGridView documentGridView;

	@Inject
	private IDocumentSearchView documentSearchView;

	@Inject
	private IDocumentFormView documentFormView;

	@Inject
	private IDocumentJustificatifView documentJustificatifView;

	@Inject
	private IDocumentPreviewView documentPreviewView;

	@UiField
	SimplePanel searchPanel;

	@UiField
	SimplePanel gridPanel;

	@UiField
	SimplePanel formPanel;

	@UiField
	SimplePanel justificatifPanel;

	@UiField
	SimplePanel previewPanel;

	private static DocumentContainerUiBinder uiBinder = GWT.create(DocumentContainerUiBinder.class);

	interface DocumentContainerUiBinder extends UiBinder<Component, DocumentContainerView> {
	}

	private Widget uiWidget = null;

	public DocumentContainerView() {
		uiWidget = uiBinder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {

		searchPanel.add(documentSearchView);
		gridPanel.add(documentGridView);
		formPanel.add(documentFormView);
		justificatifPanel.add(documentJustificatifView);
		previewPanel.add(documentPreviewView);
		// verticalLayoutContainer.setScrollMode(ScrollMode.ALWAYS);
		return uiWidget;
	}

}
